package fyp.spedmew.backend.entity;

import com.google.api.server.spi.config.AnnotationBoolean;
import com.google.api.server.spi.config.ApiResourceProperty;
import com.googlecode.objectify.Key;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Index;

import java.util.Date;

/**
 * Created by ngothanhnghi on 8/2/15.
 */
@Entity
public class CheckIn {

    @Id
    private Long id;

    @Index
    private Double lat;

    @Index
    private Double lang;

    @Index
    private Date time;

    @ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
    @Index
    private Key<Job> job;

    public Double getLat() {
        return lat;
    }

    public void setLat(Double lat) {
        this.lat = lat;
    }

    public Double getLong() {
        return lang;
    }

    public void setLong(Double lang) {
        this.lang = lang;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Key<Job> getJob() {
        return job;
    }

    public void setJob(Key<Job> job) {
        this.job = job;
    }

    public Long getJobId() {
        return job == null ? null : job.getId();
    }

    public void setJobId(Long jobId) {
        job = Key.create(Job.class, jobId);
    }
}
